package com.aaa.controller;

import com.aaa.service.PermissionService;
import com.aaa.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: qy158-system
 * @description:
 * @author: 闫克起2
 * @create: 2022-10-10 11:54
 **/
@RestController
@RequestMapping("permission")
public class PermissionController {
    @Autowired
    private PermissionService permissionService;

    @GetMapping("/leftPermission")
    public Result leftPermission(){
        return permissionService.findByUserId();
    }

    @GetMapping("/list")
    public Result list(Integer roleId){
         return permissionService.findByRoleId(roleId);
    }

    @PostMapping("qr")
    public Result qr(Integer roleId,Integer[] permissionIds){
        return permissionService.qr(roleId,permissionIds);
    }
}
